Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server column name in token entity unique constraint #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thunze
Copy link

@thunze thunze commented Nov 21, 2024

The generated name of the server column of token_entity is server_uuid, not server. The unique constraint on the table should reflect this.

I ran into this problem when trying to create the necessary database tables for Autodone on a fresh PostgreSQL database. Hibernate tries to create the token_entity table using the following SQL:

CREATE TABLE token_entity (
    server_uuid UUID NOT NULL,
    uuid UUID NOT NULL,
    token varchar(255) NOT NULL,
    username varchar(255) NOT NULL,
    PRIMARY KEY (UUID),
    UNIQUE (server, username)
);

This obviously fails because the unique constraint refers to a column named server which doesn’t exist.

The generated name of the server column is `server_uuid`, not `server`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant